<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Promise 自定义</title>
    <script src="./Promise.js"></script>
</head>
<body>
    <script>
        //调用 Promise.resolve
        // let p1 = Promise.resolve(20);
        // let p1 = Promise.resolve(
        //     new Promise((resolve, reject) => {
        //         // resolve('ok');
        //         reject('error');
        //     }));


        //调用 Promise.reject
        // let p1 = Promise.reject('失败啦~~');
        // let p1 = Promise.reject([1,2,3])
        // let p1 = Promise.reject(Promise.resolve('OK'))
        // console.log(p1);

        //测试
        // let p = Promise.resolve(Promise.resolve(Promise.resolve('123')));
        // let p = Promise.resolve(Promise.resolve(Promise.reject('123')));
        let p = Promise.reject(Promise.resolve(Promise.resolve('123')));

        console.log(p);
    </script>
</body>
</html>